<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri ="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
<head>
    <link rel="icon" href="img/weblogo.png" >
    <link rel="stylesheet" type="text/css" href="bootstrap-5.1.3-dist/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css">

    <script type="text/javascript" src="js/jquery-3.6.0-min.js"></script>
    <script type="text/javascript" src="bootstrap-5.1.3-dist/js/bootstrap.min.js"></script>
    <title>闲优购-后台管理平台</title>
</head>
<body>
<div class="row">
    <!-- 首部导航栏 -->
    <nav class="navbar navbar-dark bg-dark navbar-expand-lg">
        <div class="container-fluid text-white">
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarTogglerDemo02">
                <h5 class=""><i class="bi bi-cart4"></i>闲优购</h5>
                <ul class="navbar-nav me-lg-2 mb-0 mb-lg-1">
                    <li class="nav-item">
                        <a class="nav-link" aria-current="page" href="index.jsp"><i class="bi bi-house"></i>首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/shop_center"><i class="bi bi-shop"></i>商品中心</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="user_center.jsp"><i class="bi bi-cart-check"></i>查询订单</a>
                    </li>

                    <li class="nav-item">

                        <a class="nav-link" href="commodity_publish.jsp"><i class="bi bi-shift"></i>发布商品</a>
                    </li>

                </ul>

                <ul class="navbar-nav" style="margin-left: auto">

                    <li class="nav-item">
                        <a class="nav-link" href="user_center.jsp">
                            <i class="bi bi-clock-history"></i>
                            查询购买记录
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="user_center.jsp">
                            <i class="bi bi-person-fill"></i>
                            用户中心
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link active" href="/toAdmin">
                            <i class="bi bi-person-fill"></i>
                            管理员中心
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/loginOut">
                            <i class="bi bi-backspace-reverse"></i>
                            退出登陆
                        </a>
                    </li>

                </ul>

                当前用户: <em id="username">${sessionScope.userInfo.name}</em>

            </div>
        </div>
    </nav>

    <!-- 标题 -->
    <h5 class="display-5 text-center bg-light text-success fst-italic">
        <i class="bi bi-gear-fill"></i>
        闲优购-后台管理系统
    </h5>
    <!-- 左侧菜单栏 -->
    <div class="col-md-2 offset-md-1">
        <div class="accordion" id="accordionExample">
            <div class="accordion-item">

                <h2 class="accordion-header" id="headingOne">
                    <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
                        <i class="bi bi-people-fill"></i>
                        用户管理
                    </button>
                </h2>
                <div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
                    <div class="accordion-body">
                        <div class="list-group" id="list-1" role="tablist">
                            <a class="toOption list-group-item list-group-item-action active" data-bs-toggle="list" role="tab" data-href="/adminSelectAllUserPageable">
                                <i class="bi bi-gear"></i>
                                管理用户
                            </a>
                            <a class="toOption list-group-item list-group-item-action" data-bs-toggle="list" role="tab" aria-controls="list-profile" data-href="card_admin_update_user.jsp">
                                <i class="bi bi-pencil"></i>
                                修改用户密码
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="accordion-item">
                <h2 class="accordion-header" id="headingTwo">
                    <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
                        <i class="bi bi-shop-window"></i>
                        商品管理
                    </button>
                </h2>
                <div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#accordionExample">
                    <div class="accordion-body">
                        <div class="list-group" id="list-tab-2" role="tablist">
                            <a class="toOption list-group-item list-group-item-action active" data-bs-toggle="list" role="tab" data-href="/adminSelectAllCommodityPageable">
                                <i class="bi bi-gear"></i>
                                管理商品
                            </a>
                            <a class="toOption list-group-item list-group-item-action" data-bs-toggle="list" href="#list-profile" role="tab" aria-controls="list-profile" data-href="card_admin_total_commoidty.jsp">
                                <i class="bi bi-bar-chart-line"></i>
                                商品统计
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="accordion-item">
                <h2 class="accordion-header" id="headingThree">
                    <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
                        <i class="bi bi-wrench"></i>
                        站点管理
                    </button>
                </h2>
                <div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#accordionExample">
                    <div class="accordion-body">
                        <div class="list-group" id="list-tab-3" role="tablist">
                            <a class="toOption list-group-item list-group-item-action active" data-bs-toggle="list" role="tab" data-href="card_admin_insert_user.jsp">
                                <i class="bi bi-person-plus"></i>
                                添加新用户
                            </a>
                            <a class="toOption list-group-item list-group-item-action" data-bs-toggle="list" href="#list-profile" role="tab" aria-controls="list-profile" data-href="card_admin_total_user_action.jsp">
                                <i class="bi bi-bar-chart-line"></i>
                                用户行为统计
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <div class="col-md-8 order-md-1">
        <iframe id="iframe_main" name="iframe_main" class="col-md-12"></iframe>
    </div>
</div>
<script>
    $(document).ready(function(){

        $(".toOption").click(function(){
            $("#iframe_main").attr("src", $(this).data("href"))
            $("#iframe_main").height($(document).innerHeight())
        });
    })

</script>
</body>
</html>
